<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2017/4/27
  Time: 22:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*"%>
<%@ page import="com.scen.entity.StudentSelectCourseInfo" %>
<%@ page import="com.scen.entity.Student" %>
<%@ page import="com.scen.entity.CourseInfo" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    //获取所有的studentNumber信息
    List<Student> studentList = (List<Student>)request.getAttribute("studentList");
    //获取所有的courseNumber信息
    List<CourseInfo> courseInfoList = (List<CourseInfo>)request.getAttribute("courseInfoList");
    StudentSelectCourseInfo studentSelectCourseInfo = (StudentSelectCourseInfo)request.getAttribute("studentSelectCourseInfo");

%>
<html>
<head>
    <title>查看选课信息</title>
    <STYLE type=text/css>
        body{margin:0px; font-size:12px; background-image:url(<%=basePath%>images/bg.jpg); background-position:bottom; background-repeat:repeat-x; background-color:#A2D5F0;}
        .STYLE1 {color: #ECE9D8}
        .label {font-style:italic; }
        .errorLabel {font-style:italic;  color:red; }
        .errorMessage {font-weight:bold; color:red; }
    </STYLE>
    <script src="<%=basePath %>calendar.js"></script>
</head>
<body>
<br/><br/>
<s:fielderror cssStyle="color:red" />
<TABLE align="center" height="100%" cellSpacing=0 cellPadding=0 width="80%" border=0>
    <TBODY>
    <TR>
        <TD align="left" vAlign=top ><s:form action="" method="post" onsubmit="return checkForm();" enctype="multipart/form-data" name="form1">
            <table width='100%' cellspacing='1' cellpadding='3'  class="tablewidth">
                <tr>
                    <td width=30%>记录编号:</td>
                    <td width=70%><%=studentSelectCourseInfo.getSelectId() %></td>
                </tr>

                <tr>
                    <td width=30%>学生对象:</td>
                    <td width=70%>
                        <select name="studentSelectCourseInfo.studentNumber.studentNumber" disabled>
                                    <%
        for(Student student:studentList) {
          String selected = "";
          if(student.getStudentNumber().equals(studentSelectCourseInfo.getStudentNumber().getStudentNumber()))
            selected = "selected";
      %>
                            <option value='<%=student.getStudentNumber() %>' <%=selected %>><%=student.getStudentName() %></option>
                                    <%
        }
      %>
                    </td>
                </tr>

                <tr>
                    <td width=30%>课程对象:</td>
                    <td width=70%>
                        <select name="studentSelectCourseInfo.courseNumber.courseNumber" disabled>
                                    <%
        for(CourseInfo courseInfo:courseInfoList) {
          String selected = "";
          if(courseInfo.getCourseNumber().equals(studentSelectCourseInfo.getCourseNumber().getCourseNumber()))
            selected = "selected";
      %>
                            <option value='<%=courseInfo.getCourseNumber() %>' <%=selected %>><%=courseInfo.getCourseName() %></option>
                                    <%
        }
      %>
                    </td>
                </tr>

                <tr>
                    <td colspan="4" align="center">
                        <input type="button" value="返回" onclick="history.back();"/>
                    </td>
                </tr>

            </table>
        </s:form>
        </TD></TR>
    </TBODY>
</TABLE>
</body>
</html>
